﻿using System;
using System.Data;
using System.Configuration;

using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Collections;
using TA.JSON;

namespace TA.Turbo.Controls
{
	/// <summary>
	/// <see cref="Repeater.Command"/> event arguments.
	/// </summary>
	public class RepeaterCommandEventArgs : EventArgs, IJsonDeserializable
	{
		#region PUBLIC
		#region INIT
		/// <summary>
		/// Ctor.
		/// </summary>
		public RepeaterCommandEventArgs()
		{
			//
			// TODO: Add constructor logic here
			//
		}
		#endregion
		#region PROPS
		/// <summary>
		/// Gets or sets the command name.
		/// </summary>
		public string Command { get; set; }
		/// <summary>
		/// Gets or sets the command argument.
		/// </summary>
		public string Argument { get; set; }
		#endregion
		#endregion
		#region INTERNAL
		#region METHODS
		#region IJsonDeserializable Members
		/// <summary>
		/// Deserialize.
		/// </summary>
		/// <param name="jr"></param>
		public void Deserialize(IJsonReader jr)
		{
			this.DeserializeObject(jr);
		}
		/// <summary>
		/// DeserializeContent.
		/// </summary>
		/// <param name="jr"></param>
		/// <param name="propShortName"></param>
		public void DeserializeContent(IJsonReader jr, string propShortName)
		{
			switch (propShortName)
			{
				case "C":
					this.Command = (string)jr.Value; break;
				case "A":
					this.Argument = (string)jr.Value; break;
			}
		}
		#endregion
		#endregion
		#endregion

	}
}